
package com.scs.application.modules.base.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scs.application.core.service.IBaseService;
import com.scs.application.modules.base.dto.HospitalSupplierDTO;
import com.scs.application.modules.base.entity.HospitalSupplier;
import com.scs.application.modules.base.request.HospitalSupplierQueryRequest;
import com.scs.application.modules.base.request.HospitalSupplierRequest;
import com.scs.application.modules.base.vo.ExcelHospitalSupplierVO;
import com.scs.application.modules.base.vo.HospitalSupplierVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * HospitalSupplier service 接口
 *
 */
public interface HospitalSupplierService extends IBaseService<HospitalSupplier> {

    List<HospitalSupplier> list(HospitalSupplierQueryRequest request);


    IPage<HospitalSupplier> page(HospitalSupplierQueryRequest request);

    /**
     * 院方接口 供应商查询
     *
     * @param request 供应商识别码
     * @return 供应商信息
     */
    List<HospitalSupplierVO> listVO(HospitalSupplierRequest request);

    List<HospitalSupplierVO> listBySupplier(HospitalSupplierRequest request);

    List<HospitalSupplierVO> listByHospital(HospitalSupplierRequest request);

    /**
     * 将医院供应商状态设为正常
     *
     * @param id
     */
    void enable(String id);

    /**
     * 将医院供应商状态设为停用
     *
     * @param id
     */
    void disable(String id);

    /**
     * 根据供应商名字查询供id应商
     *
     * @param supplierName,hospitalId
     */
    HospitalSupplier findBySupplierName(String supplierName, String hospitalId);

    /**
     * 全部启用
     */
    void allActive();

    /**
     * 全部停用
     */
    void allInactive();

    /**
     *  根据供应商id获取供应商
     * @param supplierId 供应商id
     * @param hospitalId 医院ID
     * @return
     */
    HospitalSupplierVO findBySupplierIdAndHospitalId(String supplierId, String hospitalId);

    /**
     * excel导出模板查询
     */
    List<ExcelHospitalSupplierVO> listExcel(HospitalSupplierQueryRequest request);

    /**
     * 接收院方接口添加或修改医院供应商信息
     *
     * @param dtos
     */
    @Transactional(rollbackFor = Exception.class)
    List<String> batchSave(List<HospitalSupplierDTO> dtos);

}

